<?
header('Content-type: text/html; charset=utf-8');
if (preg_match("/".basename(__FILE__)."/", $_SERVER["PHP_SELF"]))
    die("<b>Error 502:</b> Access denied.");

$confdir = dirname(__FILE__)."/../includes/"; 
if(file_exists($confdir."config.php")) 	
    require $confdir."config.php";
else if(file_exists($confdir."config.default.php")) 
	require $confdir ."config.default.php";


require(DIR_INCLUDES."/functions.php");
require(DIR_INCLUDES."/functions_debug.php");

loadConfig(); // Loads all the module config files (comment it if you don't need them)


// Uses MySql database connection?
$dbLink = connectDb();
if (!$dbLink) die();

//Needs session?
/*
$sessionManager = new SessionManager();
*/


// Needs user authentication?
/*
$user = new User();
$user->setDbLink($dbLink);
$user->readSession();

// Proceed with non validated users
if(!$user->isValidated || $user->active != 'Y')
{
    header("Location: ". $GLOBALS["CONF"]["url"]["admin"] ."/login.php?action=logout");
    exit();
}
*/


?>
